var form1 = {
    type: "form",
    name: "form1",
    title: "打款单",
    "buttons": ["保存", "关闭"],
    items: [
        {
            type:"sDate",      
            title:"单据日期",
		        "allowBlank" : false, 
		        dataIndex:'dataset.financeWastebookVo.inOutDate'
        },{
    		type:"combox", 
    		title:"打款类别",
    		dataIndex : "dataset.financeWastebookVo.inAccountItemId",
    		nameIndex : "dataset.financeWastebookVo.inAccountItemName",    
    		allowBlank:false,
    		root:"dataset.dictionary",
    		fieldText:"name",
    		fieldValue:"id",
    		url:"../../dictionary.do?method=findDictionaryByTypeId&typeId="+COMBOX_DKLB
        },{
    		type:"combox", 
    		title:"资金形式",
    		dataIndex : "dataset.financeWastebookVo.accountTypeId",
    		nameIndex : "dataset.financeWastebookVo.accountTypeName",    
    		allowBlank:false,
    		root:"dataset.dictionary",
    		fieldText:"name",
    		fieldValue:"id",
    		url:"../../dictionary.do?method=findDictionaryByTypeId&typeId="+COMBOX_PRICE_TYPE
        },{
    		type:"combox", 
    		title:"打款方式",
    		dataIndex : "dataset.financeWastebookVo.inAccountMethodId",
    		nameIndex : "dataset.financeWastebookVo.inAccountMethodName",    
    		allowBlank:false,
    		root:"dataset.dictionary",
    		fieldText:"name",
    		fieldValue:"id",
    		url:"../../dictionary.do?method=findDictionaryByTypeId&typeId="+COMBOX_DKFS
        },
        {
        	type:"textArea",			
        	title:"备注",
        	dataIndex:'dataset.financeWastebookVo.remark',
        	height:80
        	},
        {
        	type:"numInput",
        	title:"金额",
        	dataIndex:'dataset.financeWastebookVo.money'
        },
        {
        	type:"input",
        	title:"经办人",
        	dataIndex:'dataset.financeWastebookVo.remark'
        }
    ],
    layoutConfig: {
        columns: 2
    },
    layout: [
         {items:[{'name':'单据日期'},{'name':'资金形式'}]},
         {items:[{'name':'打款类别'},{'name':'打款方式'}]},
         {items:[{'name':'金额'},{'name':'经办人'}]},
         {items:[{'name':'备注',colspan:2}]}
    ]

};

var obj_frame;
var page1 = new Sail.page({
    id: "page1",
    haveNavi: false,
    frames: {
        autoLoad: true,
        getUrlParameter: ['id'],
        getURL: "../../inacount.do?method=edit",
        postURL: "../../inacount.do?method=save",
        bindDataFirst : false,
        businessData: {
						"dataset": { 
							"financeWastebookVo": {
											"id":"",      
											"shopId":"FF85E8FB01704DA0AFC9825D9BA6A832",
											"inoutTypeId":"InoutType_1",
											"inAccountTypeId":"BCCD1E2AD0B142ED8616C11604280539",
											"auto":"0",
											"rollbackFlag":"0",
											"sysFlag":"1",			// 系统标志位        
											"creatorId":"",			// 创建人主键      
											"creatorName":"",		// 创建人名称    
											"createTime":"",		// 创建时间       
											"lastModifierId":"",	// 修改人主键 
											"lastModifierName":"",	// 修改人名
											"lastModifiedTime":""   // 修改时间 
			    			}
			     }
        },
        items: [form1],
        bindEvent2Items: function() {
           
        	$('form1').getButton('保存').on('click',function(){ 
                this.saveBusiness("close");
            },this);

        }
    },
  afterRun:function(){
		setDefaultValue();

              
  }    
});

function setDefaultValue(){
	if (page1.isAdd()){
		$('单据日期').setValue(getCurrentDay());
		$('打款类别').setValue("402880472e7a9a30012e7acf3d3f0026");
		$('打款类别').setText("正常");
	
		$('打款方式').setValue("402880472e7a9a30012e7ad0aa3c002a");
		$('打款方式').setText("现金");
		
		$('金额').setValue("0");
	}
}

page1.run();

